package com.vastcm.stuhealth.client;

/*  J2TablePrinter Test Application
    (C) Copyright 2009
    Wildcrest Associates
    http://www.wildcrest.com
 This source code may be freely used, modified, incorporated, and
 distributed without restriction as part of any software that uses
 J2PrinterWorks by Wildcrest Associates.
 */

import java.awt.*;
import javax.swing.*;
import com.wildcrest.j2printerworks.*;

public class J2TablePrinterPageSetupDialog
    extends javax.swing.JDialog {
  public J2TablePrinterPageSetupDialog(Frame parent) {
    super(parent);

    setResizable(false);
    setModal(true);
    getContentPane().setLayout(null);
    setSize(639, 340);
    setVisible(false);
    JPanelAll.setLayout(null);
    getContentPane().add(JPanelAll);
    JPanelAll.setBackground(new java.awt.Color(223, 223, 223));
    JPanelAll.setBounds(0, 0, 640, 426);
    JPanelHeaders.setOpaque(false);
    JPanelHeaders.setLayout(new GridLayout(1, 3, 0, 0));
    JPanelAll.add(JPanelHeaders);
    JPanelHeaders.setBounds(6, 6, 630, 34);
    JPanelLeftHeader.setAlignmentY(0.473684F);
    JPanelLeftHeader.setLayout(new BorderLayout(0, 0));
    JPanelHeaders.add(JPanelLeftHeader);
    JPanelLeftHeader.setBackground(new java.awt.Color(223, 223, 223));
    JLabelLeftHeader.setText("Left header");
    JPanelLeftHeader.add(BorderLayout.NORTH, JLabelLeftHeader);
    JLabelLeftHeader.setForeground(java.awt.Color.black);
    JLabelLeftHeader.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelLeftHeader.add(BorderLayout.SOUTH, JTextFieldLeftHeader);
    JTextFieldLeftHeader.setFont(new Font("Dialog", Font.PLAIN, 11));
    JPanelCenterHeader.setAlignmentY(0.473684F);
    JPanelCenterHeader.setLayout(new BorderLayout(0, 0));
    JPanelHeaders.add(JPanelCenterHeader);
    JPanelCenterHeader.setBackground(new java.awt.Color(223, 223, 223));
    JLabelCenterHeader.setText("Center header");
    JPanelCenterHeader.add(BorderLayout.NORTH, JLabelCenterHeader);
    JLabelCenterHeader.setForeground(java.awt.Color.black);
    JLabelCenterHeader.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelCenterHeader.add(BorderLayout.SOUTH, JTextFieldCenterHeader);
    JTextFieldCenterHeader.setFont(new Font("Dialog", Font.PLAIN, 11));
    JPanelRightHeader.setAlignmentY(0.473684F);
    JPanelRightHeader.setLayout(new BorderLayout(0, 0));
    JPanelHeaders.add(JPanelRightHeader);
    JPanelRightHeader.setBackground(new java.awt.Color(223, 223, 223));
    JLabelRightHeader.setText("Right header");
    JPanelRightHeader.add(BorderLayout.NORTH, JLabelRightHeader);
    JLabelRightHeader.setForeground(java.awt.Color.black);
    JLabelRightHeader.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelRightHeader.add(BorderLayout.SOUTH, JTextFieldRightHeader);
    JTextFieldRightHeader.setFont(new Font("Dialog", Font.PLAIN, 11));
    JPanelFooters.setOpaque(false);
    JPanelFooters.setLayout(new GridLayout(1, 3, 0, 0));
    JPanelAll.add(JPanelFooters);
    JPanelFooters.setBounds(6, 42, 630, 34);
    JPanelLeftFooter.setAlignmentY(0.473684F);
    JPanelLeftFooter.setLayout(new BorderLayout(0, 0));
    JPanelFooters.add(JPanelLeftFooter);
    JPanelLeftFooter.setBackground(new java.awt.Color(223, 223, 223));
    JLabelLeftFooter.setText("Left footer");
    JPanelLeftFooter.add(BorderLayout.NORTH, JLabelLeftFooter);
    JLabelLeftFooter.setForeground(java.awt.Color.black);
    JLabelLeftFooter.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelLeftFooter.add(BorderLayout.SOUTH, JTextFieldLeftFooter);
    JTextFieldLeftFooter.setFont(new Font("Dialog", Font.PLAIN, 11));
    JPanelCenterFooter.setAlignmentY(0.473684F);
    JPanelCenterFooter.setLayout(new BorderLayout(0, 0));
    JPanelFooters.add(JPanelCenterFooter);
    JPanelCenterFooter.setBackground(new java.awt.Color(223, 223, 223));
    JLabelCenterFooter.setText("Center footer");
    JPanelCenterFooter.add(BorderLayout.NORTH, JLabelCenterFooter);
    JLabelCenterFooter.setForeground(java.awt.Color.black);
    JLabelCenterFooter.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelCenterFooter.add(BorderLayout.SOUTH, JTextFieldCenterFooter);
    JTextFieldCenterFooter.setFont(new Font("Dialog", Font.PLAIN, 11));
    JPanelRightFooter.setAlignmentY(0.473684F);
    JPanelRightFooter.setLayout(new BorderLayout(0, 0));
    JPanelFooters.add(JPanelRightFooter);
    JPanelRightFooter.setBackground(new java.awt.Color(223, 223, 223));
    JLabelRightFooter.setText("Right footer");
    JPanelRightFooter.add(BorderLayout.NORTH, JLabelRightFooter);
    JLabelRightFooter.setForeground(java.awt.Color.black);
    JLabelRightFooter.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelRightFooter.add(BorderLayout.SOUTH, JTextFieldRightFooter);
    JTextFieldRightFooter.setFont(new Font("Dialog", Font.PLAIN, 11));
    JPanelHeaderFooterDetails.setOpaque(false);
    JPanelHeaderFooterDetails.setLayout(new GridLayout(1, 4, 0, 0));
    JPanelAll.add(JPanelHeaderFooterDetails);
    JPanelHeaderFooterDetails.setBounds(6, 114, 630, 34);
    JPanelGapBelowHeader.setAlignmentY(0.473684F);
    JPanelGapBelowHeader.setLayout(new BorderLayout(0, 0));
    JPanelHeaderFooterDetails.add(JPanelGapBelowHeader);
    JPanelGapBelowHeader.setBackground(new java.awt.Color(223, 223, 223));
    JLabelGapBelowHeader.setText("Gap below header");
    JPanelGapBelowHeader.add(BorderLayout.NORTH, JLabelGapBelowHeader);
    JLabelGapBelowHeader.setForeground(java.awt.Color.black);
    JLabelGapBelowHeader.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelGapBelowHeader.add(BorderLayout.SOUTH, JTextFieldGapBelowHeader);
    JTextFieldGapBelowHeader.setFont(new Font("Dialog", Font.PLAIN, 11));
    JPanelGapAboveFooter.setAlignmentY(0.473684F);
    JPanelGapAboveFooter.setLayout(new BorderLayout(0, 0));
    JPanelHeaderFooterDetails.add(JPanelGapAboveFooter);
    JPanelGapAboveFooter.setBackground(new java.awt.Color(223, 223, 223));
    JLabelGapAboveFooter.setText("Gap above footer");
    JPanelGapAboveFooter.add(BorderLayout.NORTH, JLabelGapAboveFooter);
    JLabelGapAboveFooter.setForeground(java.awt.Color.black);
    JLabelGapAboveFooter.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelGapAboveFooter.add(BorderLayout.SOUTH, JTextFieldGapAboveFooter);
    JTextFieldGapAboveFooter.setFont(new Font("Dialog", Font.PLAIN, 11));
    JPanelHeaderAdornments.setLayout(new GridLayout(2, 1, 0, 0));
    JPanelHeaderFooterDetails.add(JPanelHeaderAdornments);
    JCheckBoxAroundHeader.setText("Box around header");
    JCheckBoxAroundHeader.setActionCommand("Box around header");
    JPanelHeaderAdornments.add(JCheckBoxAroundHeader);
    JCheckBoxAroundHeader.setBackground(new java.awt.Color(223, 223, 223));
    JCheckBoxAroundHeader.setForeground(java.awt.Color.black);
    JCheckBoxAroundHeader.setFont(new Font("Dialog", Font.BOLD, 11));
    JCheckBoxLineBelowHeader.setText("Line below header");
    JCheckBoxLineBelowHeader.setActionCommand("Line below header");
    JPanelHeaderAdornments.add(JCheckBoxLineBelowHeader);
    JCheckBoxLineBelowHeader.setBackground(new java.awt.Color(223, 223, 223));
    JCheckBoxLineBelowHeader.setForeground(java.awt.Color.black);
    JCheckBoxLineBelowHeader.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelFooterAdornments.setLayout(new GridLayout(2, 1, 0, 0));
    JPanelHeaderFooterDetails.add(JPanelFooterAdornments);
    JCheckBoxAroundFooter.setText("Box around footer");
    JCheckBoxAroundFooter.setActionCommand("Box around footer");
    JPanelFooterAdornments.add(JCheckBoxAroundFooter);
    JCheckBoxAroundFooter.setBackground(new java.awt.Color(223, 223, 223));
    JCheckBoxAroundFooter.setForeground(java.awt.Color.black);
    JCheckBoxAroundFooter.setFont(new Font("Dialog", Font.BOLD, 11));
    JCheckBoxLineAboveFooter.setText("Line above footer");
    JCheckBoxLineAboveFooter.setActionCommand("Line above footer");
    JPanelFooterAdornments.add(JCheckBoxLineAboveFooter);
    JCheckBoxLineAboveFooter.setBackground(new java.awt.Color(223, 223, 223));
    JCheckBoxLineAboveFooter.setForeground(java.awt.Color.black);
    JCheckBoxLineAboveFooter.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelMargins.setOpaque(false);
    JPanelMargins.setLayout(new GridLayout(1, 4, 0, 0));
    JPanelAll.add(JPanelMargins);
    JPanelMargins.setBounds(6, 78, 630, 34);
    JPanelLeftMargin.setAlignmentY(0.473684F);
    JPanelLeftMargin.setLayout(new BorderLayout(0, 0));
    JPanelMargins.add(JPanelLeftMargin);
    JPanelLeftMargin.setBackground(new java.awt.Color(223, 223, 223));
    JLabelLeftMargin.setText("Left margin");
    JPanelLeftMargin.add(BorderLayout.NORTH, JLabelLeftMargin);
    JLabelLeftMargin.setForeground(java.awt.Color.black);
    JLabelLeftMargin.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelLeftMargin.add(BorderLayout.SOUTH, JTextFieldLeftMargin);
    JTextFieldLeftMargin.setFont(new Font("Dialog", Font.PLAIN, 11));
    JPanelRightMargin.setAlignmentY(0.473684F);
    JPanelRightMargin.setLayout(new BorderLayout(0, 0));
    JPanelMargins.add(JPanelRightMargin);
    JPanelRightMargin.setBackground(new java.awt.Color(223, 223, 223));
    JLabelRightMargin.setText("Right margin");
    JPanelRightMargin.add(BorderLayout.NORTH, JLabelRightMargin);
    JLabelRightMargin.setForeground(java.awt.Color.black);
    JLabelRightMargin.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelRightMargin.add(BorderLayout.SOUTH, JTextFieldRightMargin);
    JTextFieldRightMargin.setFont(new Font("Dialog", Font.PLAIN, 11));
    JPanelTopMargin.setAlignmentY(0.473684F);
    JPanelTopMargin.setLayout(new BorderLayout(0, 0));
    JPanelMargins.add(JPanelTopMargin);
    JPanelTopMargin.setBackground(new java.awt.Color(223, 223, 223));
    JLabelTopMargin.setText("Top margin");
    JPanelTopMargin.add(BorderLayout.NORTH, JLabelTopMargin);
    JLabelTopMargin.setForeground(java.awt.Color.black);
    JLabelTopMargin.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelTopMargin.add(BorderLayout.SOUTH, JTextFieldTopMargin);
    JTextFieldTopMargin.setFont(new Font("Dialog", Font.PLAIN, 11));
    JPanelBottomMargin.setAlignmentY(0.473684F);
    JPanelBottomMargin.setLayout(new BorderLayout(0, 0));
    JPanelMargins.add(JPanelBottomMargin);
    JPanelBottomMargin.setBackground(new java.awt.Color(223, 223, 223));
    JLabelBottomMargin.setText("Bottom margin");
    JPanelBottomMargin.add(BorderLayout.NORTH, JLabelBottomMargin);
    JLabelBottomMargin.setForeground(java.awt.Color.black);
    JLabelBottomMargin.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelBottomMargin.add(BorderLayout.SOUTH, JTextFieldBottomMargin);
    JTextFieldBottomMargin.setFont(new Font("Dialog", Font.PLAIN, 11));
    JPanelMisc2.setOpaque(false);
    JPanelMisc2.setLayout(new GridLayout(1, 3, 0, 0));
    JPanelAll.add(JPanelMisc2);
    JPanelMisc2.setBounds(6, 150, 630, 34);
    JPanelPrintJobName.setAlignmentY(0.473684F);
    JPanelPrintJobName.setLayout(new BorderLayout(0, 0));
    JPanelMisc2.add(JPanelPrintJobName);
    JPanelPrintJobName.setBackground(new java.awt.Color(223, 223, 223));
    JLabelPrintJobName.setText("Print job name");
    JPanelPrintJobName.add(BorderLayout.NORTH, JLabelPrintJobName);
    JLabelPrintJobName.setBackground(new java.awt.Color(223, 223, 223));
    JLabelPrintJobName.setForeground(java.awt.Color.black);
    JLabelPrintJobName.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelPrintJobName.add(BorderLayout.SOUTH, JTextFieldPrintJobName);
    JTextFieldPrintJobName.setFont(new Font("Dialog", Font.PLAIN, 11));
    JPanelHeaderFooterFont.setAlignmentY(0.473684F);
    JPanelHeaderFooterFont.setLayout(new BorderLayout(0, 0));
    JPanelMisc2.add(JPanelHeaderFooterFont);
    JPanelHeaderFooterFont.setBackground(new java.awt.Color(223, 223, 223));
    JLabelHeaderFooterFont.setText("Header/footer font");
    JPanelHeaderFooterFont.add(BorderLayout.NORTH, JLabelHeaderFooterFont);
    JLabelHeaderFooterFont.setForeground(java.awt.Color.black);
    JLabelHeaderFooterFont.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelHeaderFooterFont.add(BorderLayout.SOUTH, JTextFieldHeaderFooterFont);
    JTextFieldHeaderFooterFont.setFont(new Font("Dialog", Font.PLAIN, 11));
    JPanelScale.setAlignmentY(0.473684F);
    JPanelScale.setLayout(new BorderLayout(0, 0));
    JPanelMisc2.add(JPanelScale);
    JPanelScale.setBackground(new java.awt.Color(223, 223, 223));
    JLabelScale.setText("Scale");
    JPanelScale.add(BorderLayout.NORTH, JLabelScale);
    JLabelScale.setBackground(new java.awt.Color(223, 223, 223));
    JLabelScale.setForeground(java.awt.Color.black);
    JLabelScale.setFont(new Font("Dialog", Font.BOLD, 11));
    JTextFieldScale.setColumns(4);
    JPanelScale.add(BorderLayout.SOUTH, JTextFieldScale);
    JTextFieldScale.setFont(new Font("Dialog", Font.PLAIN, 11));
    JPanelOrientation.setAlignmentY(0.473684F);
    JPanelOrientation.setLayout(new BorderLayout(0, 0));
    JPanelMisc2.add(JPanelOrientation);
    JPanelOrientation.setBackground(new java.awt.Color(223, 223, 223));
    JLabelOrientation.setText("Orientation");
    JPanelOrientation.add(BorderLayout.NORTH, JLabelOrientation);
    JLabelOrientation.setForeground(java.awt.Color.black);
    JLabelOrientation.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelOrientation.add(BorderLayout.CENTER, JComboBoxOrientation);
    JComboBoxOrientation.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelMisc1.setOpaque(false);
    JPanelMisc1.setLayout(null);
    JPanelAll.add(JPanelMisc1);
    JPanelMisc1.setBackground(new java.awt.Color(223, 223, 223));
    JPanelMisc1.setBounds(6, 186, 630, 36);
    JCheckBoxPrintDialogUsed.setText("Use print dialog");
    JCheckBoxPrintDialogUsed.setActionCommand("Use print dialog");
    JPanelMisc1.add(JCheckBoxPrintDialogUsed);
    JCheckBoxPrintDialogUsed.setBackground(new java.awt.Color(223, 223, 223));
    JCheckBoxPrintDialogUsed.setForeground(java.awt.Color.black);
    JCheckBoxPrintDialogUsed.setFont(new Font("Dialog", Font.BOLD, 11));
    JCheckBoxPrintDialogUsed.setBounds(0, 0, 150, 36);
    JCheckBoxSeparatePrintThread.setText("Separate print thread");
    JCheckBoxSeparatePrintThread.setActionCommand("Separate print thread");
    JPanelMisc1.add(JCheckBoxSeparatePrintThread);
    JCheckBoxSeparatePrintThread.setBackground(new java.awt.Color(223, 223, 223));
    JCheckBoxSeparatePrintThread.setForeground(java.awt.Color.black);
    JCheckBoxSeparatePrintThread.setFont(new Font("Dialog", Font.BOLD, 11));
    JCheckBoxSeparatePrintThread.setBounds(151, 0, 150, 36);
    JPanelNup.setAlignmentY(0.473684F);
    JPanelNup.setLayout(new BorderLayout(0, 0));
    JPanelMisc1.add(JPanelNup);
    JPanelNup.setBackground(new java.awt.Color(223, 223, 223));
    JPanelNup.setBounds(456, 0, 152, 36);
    JLabelNup.setText("N-up printing");
    JPanelNup.add(BorderLayout.NORTH, JLabelNup);
    JLabelNup.setBackground(new java.awt.Color(223, 223, 223));
    JLabelNup.setForeground(java.awt.Color.black);
    JLabelNup.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelNup.add(JComboBoxNup);
    JComboBoxNup.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelNumberOfCopies.setAlignmentY(0.473684F);
    JPanelNumberOfCopies.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 9));
    JPanelMisc1.add(JPanelNumberOfCopies);
    JPanelNumberOfCopies.setBackground(new java.awt.Color(223, 223, 223));
    JPanelNumberOfCopies.setBounds(304, 0, 155, 36);
    JLabelNumberOfCopies.setText("Number of copies  ");
    JPanelNumberOfCopies.add(JLabelNumberOfCopies);
    JLabelNumberOfCopies.setBackground(new java.awt.Color(223, 223, 223));
    JLabelNumberOfCopies.setForeground(java.awt.Color.black);
    JLabelNumberOfCopies.setFont(new Font("Dialog", Font.BOLD, 11));
    JTextFieldNumberOfCopies.setColumns(3);
    JPanelNumberOfCopies.add(JTextFieldNumberOfCopies);
    JTextFieldNumberOfCopies.setFont(new Font("Dialog", Font.PLAIN, 11));
    JPanelOKCancel.setOpaque(false);
    JPanelOKCancel.setLayout(null);
    JPanelAll.add(JPanelOKCancel);
    JPanelOKCancel.setBackground(new java.awt.Color(223, 223, 223));
    JPanelOKCancel.setForeground(java.awt.Color.black);
    JPanelOKCancel.setBounds(108, 305, 372, 24);
    JButtonOK.setText("OK");
    JButtonOK.setActionCommand("OK");
    JPanelOKCancel.add(JButtonOK);
    JButtonOK.setBackground(java.awt.Color.lightGray);
    JButtonOK.setBounds(50, 0, 100, 23);
    JButtonCancel.setText("Cancel");
    JButtonCancel.setActionCommand("Cancel");
    JPanelOKCancel.add(JButtonCancel);
    JButtonCancel.setBackground(java.awt.Color.lightGray);
    JButtonCancel.setBounds(252, 0, 100, 23);
    JPanelPrintArea.setOpaque(false);
    JPanelPrintArea.setLayout(new GridLayout(1, 4, 0, 0));
    JPanelAll.add(JPanelPrintArea);
    JPanelPrintArea.setBounds(6, 258, 630, 34);
    JPanelLeftColumn.setAlignmentY(0.473684F);
    JPanelLeftColumn.setLayout(new BorderLayout(0, 0));
    JPanelPrintArea.add(JPanelLeftColumn);
    JPanelLeftColumn.setBackground(new java.awt.Color(223, 223, 223));
    JLabelLeftColumn.setText("Print area left column");
    JPanelLeftColumn.add(BorderLayout.NORTH, JLabelLeftColumn);
    JLabelLeftColumn.setForeground(java.awt.Color.black);
    JLabelLeftColumn.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelLeftColumn.add(BorderLayout.SOUTH, JTextFieldLeftColumn);
    JTextFieldLeftColumn.setFont(new Font("Dialog", Font.PLAIN, 11));
    JPanelTopRow.setAlignmentY(0.473684F);
    JPanelTopRow.setLayout(new BorderLayout(0, 0));
    JPanelPrintArea.add(JPanelTopRow);
    JPanelTopRow.setBackground(new java.awt.Color(223, 223, 223));
    JLabelTopRow.setText("Print area top row");
    JPanelTopRow.add(BorderLayout.NORTH, JLabelTopRow);
    JLabelTopRow.setForeground(java.awt.Color.black);
    JLabelTopRow.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelTopRow.add(BorderLayout.SOUTH, JTextFieldTopRow);
    JTextFieldTopRow.setFont(new Font("Dialog", Font.PLAIN, 11));
    JPanelNumberColumns.setAlignmentY(0.473684F);
    JPanelNumberColumns.setLayout(new BorderLayout(0, 0));
    JPanelPrintArea.add(JPanelNumberColumns);
    JPanelNumberColumns.setBackground(new java.awt.Color(223, 223, 223));
    JLabelNumberColumns.setText("Print area number of cols");
    JPanelNumberColumns.add(BorderLayout.NORTH, JLabelNumberColumns);
    JLabelNumberColumns.setForeground(java.awt.Color.black);
    JLabelNumberColumns.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelNumberColumns.add(BorderLayout.SOUTH, JTextFieldNumberColumns);
    JTextFieldNumberColumns.setFont(new Font("Dialog", Font.PLAIN, 11));
    JPanelNumberRows.setAlignmentY(0.473684F);
    JPanelNumberRows.setLayout(new BorderLayout(0, 0));
    JPanelPrintArea.add(JPanelNumberRows);
    JPanelNumberRows.setBackground(new java.awt.Color(223, 223, 223));
    JLabelNumberRows.setText("Print area number of rows");
    JPanelNumberRows.add(BorderLayout.NORTH, JLabelNumberRows);
    JLabelNumberRows.setForeground(java.awt.Color.black);
    JLabelNumberRows.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelNumberRows.add(BorderLayout.SOUTH, JTextFieldNumberRows);
    JTextFieldNumberRows.setFont(new Font("Dialog", Font.PLAIN, 11));
    JPanelMisc3.setOpaque(false);
    JPanelMisc3.setLayout(new GridLayout(1, 3, 0, 0));
    JPanelAll.add(JPanelMisc3);
    JPanelMisc3.setBounds(6, 222, 630, 36);
    JCheckBoxCenteredHorizontally.setText("Centered horizontally");
    JCheckBoxCenteredHorizontally.setActionCommand("Centered horizontally");
    JPanelMisc3.add(JCheckBoxCenteredHorizontally);
    JCheckBoxCenteredHorizontally.setBackground(new java.awt.Color(223, 223,
        223));
    JCheckBoxCenteredHorizontally.setForeground(java.awt.Color.black);
    JCheckBoxCenteredHorizontally.setFont(new Font("Dialog", Font.BOLD, 11));
    JCheckBoxCenteredVertically.setText("Centered vertically");
    JCheckBoxCenteredVertically.setActionCommand("Centered vertically");
    JPanelMisc3.add(JCheckBoxCenteredVertically);
    JCheckBoxCenteredVertically.setBackground(new java.awt.Color(223, 223, 223));
    JCheckBoxCenteredVertically.setForeground(java.awt.Color.black);
    JCheckBoxCenteredVertically.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelRowHeadings.setAlignmentY(0.473684F);
    JPanelRowHeadings.setLayout(new BorderLayout(0, 0));
    JPanelMisc3.add(JPanelRowHeadings);
    JPanelRowHeadings.setBackground(new java.awt.Color(223, 223, 223));
    JLabelRowHeadings.setText("Row headings");
    JPanelRowHeadings.add(BorderLayout.NORTH, JLabelRowHeadings);
    JLabelRowHeadings.setForeground(java.awt.Color.black);
    JLabelRowHeadings.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelRowHeadings.add(BorderLayout.CENTER, JComboBoxRowHeadings);
    JComboBoxRowHeadings.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelColumnHeadings.setAlignmentY(0.473684F);
    JPanelColumnHeadings.setLayout(new BorderLayout(0, 0));
    JPanelMisc3.add(JPanelColumnHeadings);
    JPanelColumnHeadings.setBackground(new java.awt.Color(223, 223, 223));
    JLabelColumnHeadings.setText("Column headings");
    JPanelColumnHeadings.add(BorderLayout.NORTH, JLabelColumnHeadings);
    JLabelColumnHeadings.setForeground(java.awt.Color.black);
    JLabelColumnHeadings.setFont(new Font("Dialog", Font.BOLD, 11));
    JPanelColumnHeadings.add(BorderLayout.CENTER, JComboBoxColumnHeadings);
    JComboBoxColumnHeadings.setFont(new Font("Dialog", Font.BOLD, 11));

    JComboBoxOrientation.addItem("PORTRAIT");
    JComboBoxOrientation.addItem("LANDSCAPE");
    JComboBoxOrientation.addItem("REVERSE LANDSCAPE");

    JComboBoxColumnHeadings.addItem("ALL PAGES");
    JComboBoxColumnHeadings.addItem("TOP PAGES");
    JComboBoxColumnHeadings.addItem("NONE");

    JComboBoxRowHeadings.addItem("ALL PAGES");
    JComboBoxRowHeadings.addItem("LEFT PAGES");
    JComboBoxRowHeadings.addItem("NONE");

    JComboBoxNup.addItem("1");
    JComboBoxNup.addItem("2");
    JComboBoxNup.addItem("4");
    JComboBoxNup.addItem("6");
    JComboBoxNup.addItem("9");
    JComboBoxNup.addItem("16");

    SymAction lSymAction = new SymAction();
    JButtonCancel.addActionListener(lSymAction);
    JButtonOK.addActionListener(lSymAction);
    SymItem lSymItem = new SymItem();
    JComboBoxOrientation.addItemListener(lSymItem);

    JPanelAll.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
  }

  public J2TablePrinterPageSetupDialog(J2Printer printer,
                                       J2TablePrinter tablePrinter) {
    this();
    this.printer = printer;
    this.tablePrinter = tablePrinter;
    updatePageSetupDialog();
  }

  private void updatePageSetupDialog() {
    if (printer != null && tablePrinter != null) {
      JTextFieldLeftHeader.setText(printer.getLeftHeader().toString());
      JTextFieldCenterHeader.setText(printer.getCenterHeader().toString());
      JTextFieldRightHeader.setText(printer.getRightHeader().toString());
      JTextFieldLeftFooter.setText(printer.getLeftFooter().toString());
      JTextFieldCenterFooter.setText(printer.getCenterFooter().toString());
      JTextFieldRightFooter.setText(printer.getRightFooter().toString());
      JCheckBoxAroundHeader.setSelected(printer.getHeaderStyle() ==
                                        J2Printer.BOX);
      JCheckBoxLineBelowHeader.setSelected(printer.getHeaderStyle() ==
                                           J2Printer.LINE);
      JTextFieldGapBelowHeader.setText(Double.toString(printer.
          getGapBelowHeader()));
      JTextFieldGapAboveFooter.setText(Double.toString(printer.
          getGapAboveFooter()));
      JCheckBoxAroundFooter.setSelected(printer.getFooterStyle() ==
                                        J2Printer.BOX);
      JCheckBoxLineAboveFooter.setSelected(printer.getFooterStyle() ==
                                           J2Printer.LINE);
      JTextFieldLeftMargin.setText(Double.toString(printer.getLeftMargin()));
      JTextFieldRightMargin.setText(Double.toString(printer.getRightMargin()));
      JTextFieldTopMargin.setText(Double.toString(printer.getTopMargin()));
      JTextFieldBottomMargin.setText(Double.toString(printer.getBottomMargin()));
      JTextFieldPrintJobName.setText(printer.getPrintJobName());
      JTextFieldHeaderFooterFont.setText(font2String(printer.getFooterFont()));
      if (printer.getOrientation() == J2Printer.PORTRAIT)
        JComboBoxOrientation.setSelectedIndex(0);
      if (printer.getOrientation() == J2Printer.LANDSCAPE)
        JComboBoxOrientation.setSelectedIndex(1);
      if (printer.getOrientation() == J2Printer.REVERSE_LANDSCAPE)
        JComboBoxOrientation.setSelectedIndex(2);
      rememberOrientationAtStart = JComboBoxOrientation.getSelectedIndex();
      JCheckBoxPrintDialogUsed.setSelected(printer.isPrintDialogUsed());
      JCheckBoxSeparatePrintThread.setSelected(printer.isSeparatePrintThread());
      JTextFieldNumberOfCopies.setText(Integer.toString(printer.
          getNumberOfCopies()));
      JTextFieldScale.setText(Double.toString(printer.getScale()));
      JTextFieldLeftColumn.setText(Integer.toString(tablePrinter.getPrintArea().
          x));
      JTextFieldTopRow.setText(Integer.toString(tablePrinter.getPrintArea().y));
      JTextFieldNumberColumns.setText(Integer.toString(tablePrinter.
          getPrintArea().width));
      JTextFieldNumberRows.setText(Integer.toString(tablePrinter.getPrintArea().
          height));
      JCheckBoxOutsideLines.setSelected(tablePrinter.isOutsideLines());
      JCheckBoxCenteredHorizontally.setSelected(tablePrinter.
                                                getHorizontalAlignment() ==
                                                J2TablePrinter.CENTER);
      JCheckBoxCenteredVertically.setSelected(tablePrinter.getVerticalAlignment() ==
                                              J2TablePrinter.CENTER);
      if (tablePrinter.getColumnHeaderPrinting() == J2TablePrinter.ALL_PAGES)
        JComboBoxColumnHeadings.setSelectedIndex(0);
      if (tablePrinter.getColumnHeaderPrinting() == J2TablePrinter.TOP_PAGES)
        JComboBoxColumnHeadings.setSelectedIndex(1);
      if (tablePrinter.getColumnHeaderPrinting() == J2TablePrinter.NONE)
        JComboBoxColumnHeadings.setSelectedIndex(2);
      if (tablePrinter.getRowHeaderPrinting() == J2TablePrinter.ALL_PAGES)
        JComboBoxRowHeadings.setSelectedIndex(0);
      if (tablePrinter.getRowHeaderPrinting() == J2TablePrinter.LEFT_PAGES)
        JComboBoxRowHeadings.setSelectedIndex(1);
      if (tablePrinter.getRowHeaderPrinting() == J2TablePrinter.NONE)
        JComboBoxRowHeadings.setSelectedIndex(2);
      if (printer.getNup() == 1)
        JComboBoxNup.setSelectedIndex(0);
      if (printer.getNup() == 2)
        JComboBoxNup.setSelectedIndex(1);
      if (printer.getNup() == 4)
        JComboBoxNup.setSelectedIndex(2);
      if (printer.getNup() == 6)
        JComboBoxNup.setSelectedIndex(3);
      if (printer.getNup() == 9)
        JComboBoxNup.setSelectedIndex(4);
      if (printer.getNup() == 16)
        JComboBoxNup.setSelectedIndex(5);

    }
  }

  private String font2String(Font f) {
    int style = f.getStyle();
    String styleName = "PLAIN";
    if (style == Font.BOLD)
      styleName = "BOLD";
    if (style == Font.ITALIC)
      styleName = "ITALIC";
    return f.getFamily() + "," + styleName + "," + f.getSize();
  }

  public J2TablePrinterPageSetupDialog() {
    this( (Frame)null);
  }

  public J2TablePrinterPageSetupDialog(String sTitle) {
    this();
    setTitle(sTitle);
  }

  public void setVisible(boolean b) {
    updatePageSetupDialog();
    if (b)
      this.setLocation(75, 75);
    super.setVisible(b);
  }

  static public void main(String args[]) {
    (new J2TablePrinterPageSetupDialog()).setVisible(true);
  }

  public void addNotify() {
    // Record the size of the window prior to calling parents addNotify.
    Dimension size = getSize();

    super.addNotify();

    if (frameSizeAdjusted)
      return;
    frameSizeAdjusted = true;

    // Adjust size of frame according to the insets
    Insets insets = getInsets();
    setSize(insets.left + insets.right + size.width,
            insets.top + insets.bottom + size.height);
  }

  // Used by addNotify
  boolean frameSizeAdjusted = false;

  javax.swing.JPanel JPanelAll = new javax.swing.JPanel();
  javax.swing.JPanel JPanelHeaders = new javax.swing.JPanel();
  javax.swing.JPanel JPanelLeftHeader = new javax.swing.JPanel();
  javax.swing.JLabel JLabelLeftHeader = new javax.swing.JLabel();
  javax.swing.JTextField JTextFieldLeftHeader = new javax.swing.JTextField();
  javax.swing.JPanel JPanelCenterHeader = new javax.swing.JPanel();
  javax.swing.JLabel JLabelCenterHeader = new javax.swing.JLabel();
  javax.swing.JTextField JTextFieldCenterHeader = new javax.swing.JTextField();
  javax.swing.JPanel JPanelRightHeader = new javax.swing.JPanel();
  javax.swing.JLabel JLabelRightHeader = new javax.swing.JLabel();
  javax.swing.JTextField JTextFieldRightHeader = new javax.swing.JTextField();
  javax.swing.JPanel JPanelFooters = new javax.swing.JPanel();
  javax.swing.JPanel JPanelLeftFooter = new javax.swing.JPanel();
  javax.swing.JLabel JLabelLeftFooter = new javax.swing.JLabel();
  javax.swing.JTextField JTextFieldLeftFooter = new javax.swing.JTextField();
  javax.swing.JPanel JPanelCenterFooter = new javax.swing.JPanel();
  javax.swing.JLabel JLabelCenterFooter = new javax.swing.JLabel();
  javax.swing.JTextField JTextFieldCenterFooter = new javax.swing.JTextField();
  javax.swing.JPanel JPanelRightFooter = new javax.swing.JPanel();
  javax.swing.JLabel JLabelRightFooter = new javax.swing.JLabel();
  javax.swing.JTextField JTextFieldRightFooter = new javax.swing.JTextField();
  javax.swing.JPanel JPanelHeaderFooterDetails = new javax.swing.JPanel();
  javax.swing.JPanel JPanelGapBelowHeader = new javax.swing.JPanel();
  javax.swing.JLabel JLabelGapBelowHeader = new javax.swing.JLabel();
  javax.swing.JTextField JTextFieldGapBelowHeader = new javax.swing.JTextField();
  javax.swing.JPanel JPanelGapAboveFooter = new javax.swing.JPanel();
  javax.swing.JLabel JLabelGapAboveFooter = new javax.swing.JLabel();
  javax.swing.JTextField JTextFieldGapAboveFooter = new javax.swing.JTextField();
  javax.swing.JPanel JPanelHeaderAdornments = new javax.swing.JPanel();
  javax.swing.JCheckBox JCheckBoxAroundHeader = new javax.swing.JCheckBox();
  javax.swing.JCheckBox JCheckBoxLineBelowHeader = new javax.swing.JCheckBox();
  javax.swing.JPanel JPanelFooterAdornments = new javax.swing.JPanel();
  javax.swing.JCheckBox JCheckBoxAroundFooter = new javax.swing.JCheckBox();
  javax.swing.JCheckBox JCheckBoxLineAboveFooter = new javax.swing.JCheckBox();
  javax.swing.JPanel JPanelMargins = new javax.swing.JPanel();
  javax.swing.JPanel JPanelLeftMargin = new javax.swing.JPanel();
  javax.swing.JLabel JLabelLeftMargin = new javax.swing.JLabel();
  javax.swing.JTextField JTextFieldLeftMargin = new javax.swing.JTextField();
  javax.swing.JPanel JPanelRightMargin = new javax.swing.JPanel();
  javax.swing.JLabel JLabelRightMargin = new javax.swing.JLabel();
  javax.swing.JTextField JTextFieldRightMargin = new javax.swing.JTextField();
  javax.swing.JPanel JPanelTopMargin = new javax.swing.JPanel();
  javax.swing.JLabel JLabelTopMargin = new javax.swing.JLabel();
  javax.swing.JTextField JTextFieldTopMargin = new javax.swing.JTextField();
  javax.swing.JPanel JPanelBottomMargin = new javax.swing.JPanel();
  javax.swing.JLabel JLabelBottomMargin = new javax.swing.JLabel();
  javax.swing.JTextField JTextFieldBottomMargin = new javax.swing.JTextField();
  javax.swing.JPanel JPanelMisc2 = new javax.swing.JPanel();
  javax.swing.JPanel JPanelPrintJobName = new javax.swing.JPanel();
  javax.swing.JLabel JLabelPrintJobName = new javax.swing.JLabel();
  javax.swing.JTextField JTextFieldPrintJobName = new javax.swing.JTextField();
  javax.swing.JPanel JPanelHeaderFooterFont = new javax.swing.JPanel();
  javax.swing.JLabel JLabelHeaderFooterFont = new javax.swing.JLabel();
  javax.swing.JTextField JTextFieldHeaderFooterFont = new javax.swing.
      JTextField();
  javax.swing.JPanel JPanelScale = new javax.swing.JPanel();
  javax.swing.JLabel JLabelScale = new javax.swing.JLabel();
  javax.swing.JTextField JTextFieldScale = new javax.swing.JTextField();
  javax.swing.JPanel JPanelOrientation = new javax.swing.JPanel();
  javax.swing.JLabel JLabelOrientation = new javax.swing.JLabel();
  javax.swing.JComboBox JComboBoxOrientation = new javax.swing.JComboBox();
  javax.swing.JPanel JPanelMisc1 = new javax.swing.JPanel();
  javax.swing.JCheckBox JCheckBoxPrintDialogUsed = new javax.swing.JCheckBox();
  javax.swing.JCheckBox JCheckBoxSeparatePrintThread = new javax.swing.
      JCheckBox();
  javax.swing.JPanel JPanelNup = new javax.swing.JPanel();
  javax.swing.JLabel JLabelNup = new javax.swing.JLabel();
  javax.swing.JComboBox JComboBoxNup = new javax.swing.JComboBox();
  javax.swing.JPanel JPanelNumberOfCopies = new javax.swing.JPanel();
  javax.swing.JLabel JLabelNumberOfCopies = new javax.swing.JLabel();
  javax.swing.JTextField JTextFieldNumberOfCopies = new javax.swing.JTextField();
  javax.swing.JPanel JPanelOKCancel = new javax.swing.JPanel();
  javax.swing.JButton JButtonOK = new javax.swing.JButton();
  javax.swing.JButton JButtonCancel = new javax.swing.JButton();
  javax.swing.JPanel JPanelPrintArea = new javax.swing.JPanel();
  javax.swing.JPanel JPanelLeftColumn = new javax.swing.JPanel();
  javax.swing.JLabel JLabelLeftColumn = new javax.swing.JLabel();
  javax.swing.JTextField JTextFieldLeftColumn = new javax.swing.JTextField();
  javax.swing.JPanel JPanelTopRow = new javax.swing.JPanel();
  javax.swing.JLabel JLabelTopRow = new javax.swing.JLabel();
  javax.swing.JTextField JTextFieldTopRow = new javax.swing.JTextField();
  javax.swing.JPanel JPanelNumberColumns = new javax.swing.JPanel();
  javax.swing.JLabel JLabelNumberColumns = new javax.swing.JLabel();
  javax.swing.JTextField JTextFieldNumberColumns = new javax.swing.JTextField();
  javax.swing.JPanel JPanelNumberRows = new javax.swing.JPanel();
  javax.swing.JLabel JLabelNumberRows = new javax.swing.JLabel();
  javax.swing.JTextField JTextFieldNumberRows = new javax.swing.JTextField();
  javax.swing.JPanel JPanelMisc3 = new javax.swing.JPanel();
  javax.swing.JCheckBox JCheckBoxCenteredHorizontally = new javax.swing.
      JCheckBox();
  javax.swing.JCheckBox JCheckBoxCenteredVertically = new javax.swing.JCheckBox();
  javax.swing.JCheckBox JCheckBoxOutsideLines = new javax.swing.JCheckBox();
  javax.swing.JPanel JPanelColumnHeadings = new javax.swing.JPanel();
  javax.swing.JLabel JLabelColumnHeadings = new javax.swing.JLabel();
  javax.swing.JComboBox JComboBoxColumnHeadings = new javax.swing.JComboBox();
  javax.swing.JPanel JPanelRowHeadings = new javax.swing.JPanel();
  javax.swing.JLabel JLabelRowHeadings = new javax.swing.JLabel();
  javax.swing.JComboBox JComboBoxRowHeadings = new javax.swing.JComboBox();

  J2Printer printer;
  J2TablePrinter tablePrinter;
  int rememberOrientationAtStart;

  class SymAction
      implements java.awt.event.ActionListener {
    public void actionPerformed(java.awt.event.ActionEvent event) {
      Object object = event.getSource();
      if (object == JButtonCancel)
        JButtonCancel_actionPerformed(event);
      else if (object == JButtonOK)
        JButtonOK_actionPerformed(event);
    }
  }

  void JButtonCancel_actionPerformed(java.awt.event.ActionEvent event) {
    JButtonCancel_actionPerformed_Interaction1(event);
  }

  void JButtonCancel_actionPerformed_Interaction1(java.awt.event.ActionEvent
                                                  event) {
    try {
      // JPageSetupDialog Hide the JPageSetupDialog
      JComboBoxOrientation.setSelectedIndex(rememberOrientationAtStart); // restore orientation if cancelled
      if (rememberOrientationAtStart == 0)
        printer.setOrientation(J2Printer.PORTRAIT);
      if (rememberOrientationAtStart == 1)
        printer.setOrientation(J2Printer.LANDSCAPE);
      if (rememberOrientationAtStart == 2)
        printer.setOrientation(J2Printer.REVERSE_LANDSCAPE);
      this.setVisible(false);
    }
    catch (Exception e) {
    }
  }

  void JButtonOK_actionPerformed(java.awt.event.ActionEvent event) {
    JButtonOK_actionPerformed_Interaction1(event);
  }

  void JButtonOK_actionPerformed_Interaction1(java.awt.event.ActionEvent event) {
    updateJ2TablePrinter();
    try {
      // JPageSetupDialog Hide the JPageSetupDialog
      this.setVisible(false);
    }
    catch (Exception e) {
    }
  }

  private void updateJ2TablePrinter() {
    if (printer != null && tablePrinter != null) {
      printer.setLeftHeader(JTextFieldLeftHeader.getText());
      printer.setCenterHeader(JTextFieldCenterHeader.getText());
      printer.setRightHeader(JTextFieldRightHeader.getText());
      printer.setLeftFooter(JTextFieldLeftFooter.getText());
      printer.setCenterFooter(JTextFieldCenterFooter.getText());
      printer.setRightFooter(JTextFieldRightFooter.getText());
      int headerStyle = J2Printer.NONE;
      if (JCheckBoxLineBelowHeader.isSelected())
        headerStyle = J2Printer.LINE;
      if (JCheckBoxAroundHeader.isSelected())
        headerStyle = J2Printer.BOX;
      printer.setHeaderStyle(headerStyle);
      printer.setGapBelowHeader(Double.valueOf(JTextFieldGapBelowHeader.getText()).
                                doubleValue());
      printer.setGapAboveFooter(Double.valueOf(JTextFieldGapAboveFooter.getText()).
                                doubleValue());
      int footerStyle = J2Printer.NONE;
      if (JCheckBoxLineAboveFooter.isSelected())
        footerStyle = J2Printer.LINE;
      if (JCheckBoxAroundFooter.isSelected())
        footerStyle = J2Printer.BOX;
      printer.setFooterStyle(footerStyle);
      printer.setLeftMargin(Double.valueOf(JTextFieldLeftMargin.getText()).
                            doubleValue());
      printer.setRightMargin(Double.valueOf(JTextFieldRightMargin.getText()).
                             doubleValue());
      printer.setTopMargin(Double.valueOf(JTextFieldTopMargin.getText()).
                           doubleValue());
      printer.setBottomMargin(Double.valueOf(JTextFieldBottomMargin.getText()).
                              doubleValue());
      if (JComboBoxOrientation.getSelectedIndex() == 0)
        printer.setOrientation(J2Printer.PORTRAIT);
      if (JComboBoxOrientation.getSelectedIndex() == 1)
        printer.setOrientation(J2Printer.LANDSCAPE);
      if (JComboBoxOrientation.getSelectedIndex() == 2)
        printer.setOrientation(J2Printer.REVERSE_LANDSCAPE);
      printer.setPrintJobName(JTextFieldPrintJobName.getText());
      printer.setHeaderFont(string2Font(JTextFieldHeaderFooterFont.getText()));
      printer.setFooterFont(string2Font(JTextFieldHeaderFooterFont.getText()));
      printer.setPrintDialogUsed(JCheckBoxPrintDialogUsed.isSelected());
      printer.setSeparatePrintThread(JCheckBoxSeparatePrintThread.isSelected());
      printer.setNumberOfCopies(Integer.valueOf(JTextFieldNumberOfCopies.
                                                getText()).intValue());
      printer.setScale(Double.valueOf(JTextFieldScale.getText()).doubleValue());
      tablePrinter.setPrintArea(
          Integer.valueOf(JTextFieldLeftColumn.getText()).intValue(),
          Integer.valueOf(JTextFieldTopRow.getText()).intValue(),
          Integer.valueOf(JTextFieldNumberColumns.getText()).intValue(),
          Integer.valueOf(JTextFieldNumberRows.getText()).intValue());
      tablePrinter.setOutsideLines(JCheckBoxOutsideLines.isSelected());
      tablePrinter.setHorizontalAlignment(JCheckBoxCenteredHorizontally.
                                          isSelected() ? J2Pageable.CENTER :
                                          J2Pageable.LEFT);
      tablePrinter.setVerticalAlignment(JCheckBoxCenteredVertically.isSelected() ?
                                        J2Pageable.CENTER : J2Pageable.LEFT);
      if (JComboBoxColumnHeadings.getSelectedIndex() == 0)
        tablePrinter.setColumnHeaderPrinting(J2TablePrinter.ALL_PAGES);
      if (JComboBoxColumnHeadings.getSelectedIndex() == 1)
        tablePrinter.setColumnHeaderPrinting(J2TablePrinter.TOP_PAGES);
      if (JComboBoxColumnHeadings.getSelectedIndex() == 2)
        tablePrinter.setColumnHeaderPrinting(J2TablePrinter.NONE);
      if (JComboBoxRowHeadings.getSelectedIndex() == 0)
        tablePrinter.setRowHeaderPrinting(J2TablePrinter.ALL_PAGES);
      if (JComboBoxRowHeadings.getSelectedIndex() == 1)
        tablePrinter.setRowHeaderPrinting(J2TablePrinter.LEFT_PAGES);
      if (JComboBoxRowHeadings.getSelectedIndex() == 2)
        tablePrinter.setRowHeaderPrinting(J2TablePrinter.NONE);
      printer.setNup(1);
      if (JComboBoxNup.getSelectedIndex() == 1)
        printer.setNup(2);
      if (JComboBoxNup.getSelectedIndex() == 2)
        printer.setNup(4);
      if (JComboBoxNup.getSelectedIndex() == 3)
        printer.setNup(6);
      if (JComboBoxNup.getSelectedIndex() == 4)
        printer.setNup(9);
      if (JComboBoxNup.getSelectedIndex() == 5)
        printer.setNup(16);
    }
  }

  private Font string2Font(String s) {
    int firstcomma = s.indexOf(",");
    int lastcomma = s.lastIndexOf(",");
    String font = s.substring(0, firstcomma);
    String stylename = s.substring(firstcomma + 1, lastcomma);
    int style = Font.PLAIN;
    if (stylename.equals("BOLD"))
      style = Font.BOLD;
    if (stylename.equals("ITALIC"))
      style = Font.ITALIC;
    int size = Integer.valueOf(s.substring(lastcomma + 1)).intValue();
    return new Font(font, style, size);
  }

  class SymItem
      implements java.awt.event.ItemListener {
    public void itemStateChanged(java.awt.event.ItemEvent event) {
      Object object = event.getSource();
      if (object == JComboBoxOrientation)
        JComboBoxOrientation_itemStateChanged(event);
    }
  }

  void JComboBoxOrientation_itemStateChanged(java.awt.event.ItemEvent event) {
    // change of orientation causes change in unprintable margins
    if (JComboBoxOrientation.getSelectedIndex() == 0)
      printer.setOrientation(J2Printer.PORTRAIT);
    if (JComboBoxOrientation.getSelectedIndex() == 1)
      printer.setOrientation(J2Printer.LANDSCAPE);
    if (JComboBoxOrientation.getSelectedIndex() == 2)
      printer.setOrientation(J2Printer.REVERSE_LANDSCAPE);
    repaint();
  }
}
